﻿@model MvcDatagrid.Models.Employees

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Employees</legend>

        @Html.HiddenFor(model => model.EmployeeID)

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TitleOfCourtesy)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TitleOfCourtesy)
            @Html.ValidationMessageFor(model => model.TitleOfCourtesy)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.BirthDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.BirthDate)
            @Html.ValidationMessageFor(model => model.BirthDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.HireDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.HireDate)
            @Html.ValidationMessageFor(model => model.HireDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Address)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.City)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.City)
            @Html.ValidationMessageFor(model => model.City)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Region)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Region)
            @Html.ValidationMessageFor(model => model.Region)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostalCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostalCode)
            @Html.ValidationMessageFor(model => model.PostalCode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Country)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Country)
            @Html.ValidationMessageFor(model => model.Country)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.HomePhone)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.HomePhone)
            @Html.ValidationMessageFor(model => model.HomePhone)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Extension)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Extension)
            @Html.ValidationMessageFor(model => model.Extension)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Notes)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Notes)
            @Html.ValidationMessageFor(model => model.Notes)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ReportsTo, "Employees2")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ReportsTo", String.Empty)
            @Html.ValidationMessageFor(model => model.ReportsTo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PhotoPath)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PhotoPath)
            @Html.ValidationMessageFor(model => model.PhotoPath)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
